```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>反转单向链表 - 可视化解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-bg {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        }
        .code-block {
            background-color: #1e293b;
            border-left: 4px solid #8b5cf6;
        }
        .node {
            transition: all 0.3s ease;
        }
        .node:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        .arrow {
            transition: all 0.3s ease;
        }
        .step-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero-bg text-white py-20 md:py-32 px-4">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="serif text-4xl md:text-6xl font-bold mb-6">反转单向链表</h1>
            <p class="text-xl md:text-2xl font-light max-w-3xl mx-auto mb-8 opacity-90">
                深入理解经典链表操作的艺术与逻辑
            </p>
            <div class="flex justify-center space-x-4">
                <a href="#concept" class="px-6 py-3 bg-white text-indigo-600 rounded-full font-medium hover:bg-gray-100 transition duration-300">
                    <i class="fas fa-book mr-2"></i>概念解析
                </a>
                <a href="#visualization" class="px-6 py-3 bg-indigo-800 text-white rounded-full font-medium hover:bg-indigo-700 transition duration-300">
                    <i class="fas fa-project-diagram mr-2"></i>可视化
                </a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto max-w-5xl px-4 py-12">
        <!-- Concept Section -->
        <section id="concept" class="mb-20">
            <h2 class="serif text-3xl font-bold mb-6 text-gray-800 border-b pb-2">概念解析</h2>
            <div class="prose max-w-none">
                <p class="text-lg text-gray-700 leading-relaxed mb-6">
                    反转单向链表是一项经典的链表操作。其目的是将链表中所有节点的指向方向颠倒，使得原来的尾节点变成头节点，原来的头节点变成尾节点。这个操作在数据结构和算法中具有重要意义，它不仅考察了对指针操作的理解，也是面试中的常见问题。
                </p>
                
                <div class="bg-blue-50 border-l-4 border-blue-500 p-4 my-6 rounded">
                    <div class="flex">
                        <div class="flex-shrink-0">
                            <i class="fas fa-lightbulb text-blue-500 text-2xl mt-1"></i>
                        </div>
                        <div class="ml-3">
                            <h3 class="text-lg font-medium text-blue-800">关键理解点</h3>
                            <div class="mt-2 text-blue-700">
                                <p>反转链表的核心在于改变每个节点的<code class="bg-blue-100 px-2 py-1 rounded">next</code>指针的指向，同时不丢失对后续节点的引用。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Steps Section -->
        <section id="steps" class="mb-20">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 border-b pb-2">反转单向链表的步骤</h2>
            
            <div class="grid md:grid-cols-3 gap-8">
                <!-- Step 1 -->
                <div class="step-card bg-white rounded-xl shadow-lg p-6 transition duration-300">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-800 w-10 h-10 rounded-full flex items-center justify-center font-bold text-xl mr-3">1</div>
                        <h3 class="text-xl font-bold text-gray-800">初始化指针</h3>
                    </div>
                    <div class="text-gray-600">
                        <p>使用三个指针来帮助反转链表：</p>
                        <ul class="list-disc pl-5 mt-2 space-y-1">
                            <li><code class="bg-gray-100 px-1 py-0.5 rounded">prev</code> - 记录当前节点的前一个节点，初始为 <code class="bg-gray-100 px-1 py-0.5 rounded">null</code></li>
                            <li><code class="bg-gray-100 px-1 py-0.5 rounded">current</code> - 当前遍历的节点，初始为头节点</li>
                            <li><code class="bg-gray-100 px-1 py-0.5 rounded">next</code> - 临时保存下一个节点</li>
                        </ul>
                    </div>
                </div>

                <!-- Step 2 -->
                <div class="step-card bg-white rounded-xl shadow-lg p-6 transition duration-300">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-800 w-10 h-10 rounded-full flex items-center justify-center font-bold text-xl mr-3">2</div>
                        <h3 class="text-xl font-bold text-gray-800">遍历链表</h3>
                    </div>
                    <div class="text-gray-600">
                        <p>逐步调整每个节点的指针指向：</p>
                        <ol class="list-decimal pl-5 mt-2 space-y-1">
                            <li>保存<code class="bg-gray-100 px-1 py-0.5 rounded">current.next</code>到<code class="bg-gray-100 px-1 py-0.5 rounded">next</code></li>
                            <li>将<code class="bg-gray-100 px-1 py-0.5 rounded">current.next</code>指向<code class="bg-gray-100 px-1 py-0.5 rounded">prev</code></li>
                            <li>移动<code class="bg-gray-100 px-1 py-0.5 rounded">prev</code>和<code class="bg-gray-100 px-1 py-0.5 rounded">current</code>指针</li>
                        </ol>
                    </div>
                </div>

                <!-- Step 3 -->
                <div class="step-card bg-white rounded-xl shadow-lg p-6 transition duration-300">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-800 w-10 h-10 rounded-full flex items-center justify-center font-bold text-xl mr-3">3</div>
                        <h3 class="text-xl font-bold text-gray-800">完成反转</h3>
                    </div>
                    <div class="text-gray-600">
                        <p>当<code class="bg-gray-100 px-1 py-0.5 rounded">current</code>变为<code class="bg-gray-100 px-1 py-0.5 rounded">null</code>时：</p>
                        <ul class="list-disc pl-5 mt-2 space-y-1">
                            <li>链表已经完全反转</li>
                            <li><code class="bg-gray-100 px-1 py-0.5 rounded">prev</code>指向新的头节点</li>
                            <li>返回<code class="bg-gray-100 px-1 py-0.5 rounded">prev</code>作为结果</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Visualization Section -->
        <section id="visualization" class="mb-20">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 border-b pb-2">可视化演示</h2>
            
            <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
                <h3 class="text-xl font-bold mb-4 text-gray-700">初始链表状态</h3>
                <div class="flex items-center justify-center flex-wrap my-8">
                    <div class="node bg-indigo-100 text-indigo-800 rounded-lg p-4 m-2 shadow-md">
                        <div class="font-bold text-center">1</div>
                        <div class="text-xs text-center mt-1">头节点</div>
                    </div>
                    <div class="arrow text-gray-400 text-xl px-2">
                        <i class="fas fa-arrow-right"></i>
                    </div>
                    <div class="node bg-indigo-100 text-indigo-800 rounded-lg p-4 m-2 shadow-md">
                        <div class="font-bold text-center">2</div>
                    </div>
                    <div class="arrow text-gray-400 text-xl px-2">
                        <i class="fas fa-arrow-right"></i>
                    </div>
                    <div class="node bg-indigo-100 text-indigo-800 rounded-lg p-4 m-2 shadow-md">
                        <div class="font-bold text-center">3</div>
                    </div>
                    <div class="arrow text-gray-400 text-xl px-2">
                        <i class="fas fa-arrow-right"></i>
                    </div>
                    <div class="node bg-indigo-100 text-indigo-800 rounded-lg p-4 m-2 shadow-md">
                        <div class="font-bold text-center">4</div>
                    </div>
                    <div class="arrow text-gray-400 text-xl px-2">
                        <i class="fas fa-arrow-right"></i>
                    </div>
                    <div class="node bg-indigo-100 text-indigo-800 rounded-lg p-4 m-2 shadow-md">
                        <div class="font-bold text-center">5</div>
                        <div class="text-xs text-center mt-1">尾节点</div>
                    </div>
                </div>
                
                <div class="flex justify-center mt-8">
                    <button id="nextStepBtn" class="px-6 py-3 bg-indigo-600 text-white rounded-full font-medium hover:bg-indigo-700 transition duration-300 flex items-center">
                        <i class="fas fa-play mr-2"></i>开始演示反转过程
                    </button>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-lg p-6">
                <h3 class="text-xl font-bold mb-4 text-gray-700">指针状态图示</h3>
                <div class="mermaid">
                    graph LR
                    A[prev: null] --> B[current: 1]
                    B --> C[next: 2]
                    B -->|指向 prev| A
                </div>
            </div>
        </section>

        <!-- Code Implementation -->
        <section id="code" class="mb-20">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 border-b pb-2">代码实现</h2>
            
            <div class="mb-8">
                <div class="flex items-center mb-4">
                    <i class="fas fa-code text-indigo-500 text-xl mr-2"></i>
                    <h3 class="text-xl font-bold text-gray-700">Java 实现</h3>
                </div>
                <div class="code-block rounded-lg overflow-hidden">
                    <pre class="p-4 text-gray-300 overflow-x-auto"><code>
// 链表节点类
static class ListNode {
    int val;
    ListNode next;

    ListNode(int val) {
        this.val = val;
        this.next = null;
    }
}

// 反转链表方法
public static ListNode reverseList(ListNode head) {
    ListNode prev = null; // 初始时，前一个节点为空
    ListNode current = head; // 当前节点从头节点开始

    while (current != null) {
        ListNode next = current.next; // 暂时保存下一个节点
        current.next = prev; // 反转当前节点的指针
        prev = current; // 更新前一个节点为当前节点
        current = next; // 移动到下一个节点
    }

    return prev; // 返回新的头节点
}
                    </code></pre>
                </div>
            </div>
            
            <div class="bg-white rounded-xl shadow-lg p-6">
                <h3 class="text-xl font-bold mb-4 text-gray-700">代码解析</h3>
                <div class="grid md:grid-cols-2 gap-6">
                    <div>
                        <h4 class="font-medium text-gray-800 mb-2">1. 初始化指针</h4>
                        <p class="text-gray-600">
                            <code class="bg-gray-100 px-1 py-0.5 rounded">prev</code> 初始化为 <code class="bg-gray-100 px-1 py-0.5 rounded">null</code>，<code class="bg-gray-100 px-1 py-0.5 rounded">current</code> 初始化为链表的头节点。
                        </p>
                    </div>
                    <div>
                        <h4 class="font-medium text-gray-800 mb-2">2. 反转操作</h4>
                        <p class="text-gray-600">
                            通过循环遍历链表，逐步将每个节点的 <code class="bg-gray-100 px-1 py-0.5 rounded">next</code> 指针指向前一个节点 (<code class="bg-gray-100 px-1 py-0.5 rounded">prev</code>)。
                        </p>
                    </div>
                    <div>
                        <h4 class="font-medium text-gray-800 mb-2">3. 指针移动</h4>
                        <p class="text-gray-600">
                            更新 <code class="bg-gray-100 px-1 py-0.5 rounded">prev</code> 和 <code class="bg-gray-100 px-1 py-0.5 rounded">current</code> 指针，直到遍历完整个链表。
                        </p>
                    </div>
                    <div>
                        <h4 class="font-medium text-gray-800 mb-2">4. 返回结果</h4>
                        <p class="text-gray-600">
                            当 <code class="bg-gray-100 px-1 py-0.5 rounded">current</code> 指针为 <code class="bg-gray-100 px-1 py-0.5 rounded">null</code> 时，<code class="bg-gray-100 px-1 py-0.5 rounded">prev</code> 指针指向新的头节点。
                        </p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Output Section -->
        <section id="output" class="mb-20">
            <h2 class="serif text-3xl font-bold mb-8 text-gray-800 border-b pb-2">输出结果</h2>
            
            <div class="bg-white rounded-xl shadow-lg p-6">
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">输出</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">原链表</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono">1 → 2 → 3 → 4 → 5</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">反转后的链表</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono">5 → 4 → 3 → 2 → 1</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>

        <!-- Summary Section -->
        <section class="bg-indigo-50 rounded-xl p-8 mb-20">
            <div class="flex items-start">
                <div class="flex-shrink-0">
                    <i class="fas fa-check-circle text-indigo-600 text-3xl mt-1"></i>
                </div>
                <div class="ml-4">
                    <h3 class="text-xl font-bold text-gray-800 mb-4">关键要点总结</h3>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700">
                        <li>反转链表需要<strong>三个指针</strong>协同工作：<code class="bg-indigo-100 px-1 py-0.5 rounded">prev</code>, <code class="bg-indigo-100 px-1 py-0.5 rounded">current</code>, <code class="bg-indigo-100 px-1 py-0.5 rounded">next</code></li>
                        <li>核心操作是在遍历过程中<strong>改变每个节点的<code class="bg-indigo-100 px-1 py-0.5 rounded">next</code>指针指向</strong></li>
                        <li>必须<strong>先保存</strong>下一个节点的引用，再改变当前节点的<code class="bg-indigo-100 px-1 py-0.5 rounded">next</code>指针</li>
                        <li>时间复杂度为<strong>O(n)</strong>，空间复杂度为<strong>O(1)</strong></li>
                        <li>边界情况处理：空链表或只有一个节点的链表</li>
                    </ul>
                </div>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300 flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'dark',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true
            }
        });

        // 简单的交互演示
        document.getElementById('nextStepBtn').addEventListener('click', function() {
            alert('交互演示将在这里逐步展示链表反转过程...');
        });
    </script>
</body>
</html>
```